package com.xzzz.irda.guardcat.server;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 服务端配置
 *
 * @author xzzz
 */
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "xzzz.guardcat.server")
public class GuardcatServerProperties {

    /**
     * 每台机器的拉取间隔,毫秒
     */
    private long fetchMachineInterval = 1000 * 15;

    /**
     * 服务端存储配置
     */
    private Repository repository;

    @PostConstruct
    public void init() {
        log.info("[GUARDCAT] 指标拉取间隔[{}]", this.fetchMachineInterval);
    }

    /**
     * 服务端存储配置
     */
    @Data
    public static class Repository {
        /**
         * 存储的类型
         */
        private RepositoryTypeEnum type = RepositoryTypeEnum.mysql;
    }
}
